package cn.com.dal.dao.impl.ref;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import cn.com.dal.dao.ref.RefUserRoleDAO;
import cn.com.dal.dataobject.ref.RefUserRoleDO;
import cn.com.support.dal.DAOException;
import cn.com.support.dal.DefaultDAO;

@Repository
public class RefUserRoleDAOImpl<T extends RefUserRoleDO> extends DefaultDAO<T>
		implements RefUserRoleDAO<T> {

	@Override
	protected String getSatementPackage() {
		return "cn.com.dal.dao.ref.RefUserRoleDAO";
	}

	@Override
	public String selectRoleName(Long userid) throws DAOException{
		try {
			Map<String, Long> queryMap = new HashMap<String, Long>();
			queryMap.put("userId", userid);
			return super.getSqlSession().selectOne(getSatementPackage() + ".selectRoleName", queryMap);	
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

}
